﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="messaggi_lookup_list.aspx.vb" Inherits="m_gestione_messaggi_list" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Lista Messaggi</title>
    <link href="/timereport/include/commoncss.aspx" rel="stylesheet" type="text/css" />
</head>

<script language="JavaScript" src="/timereport/include/menu/menu_array.js" type="text/javascript"></script>
<script language="JavaScript" src="/timereport/include/menu/mmenu.js" type="text/javascript"></script>

<body>
   
   <table width="760" border="0">
        <tr>
            <td height="30" class="BarraTop" align="right">
                Utente:
                <%= session("UserName") %>
            </td>
    </table>

   <table width="760" border="0" class="GridTab">

    <td>

    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" EnableModelValidation="True" 
            AllowSorting="True" CssClass="GridView" GridLines="None" 
            AllowPaging="True" DataKeyNames="MessaggioID"
            OnSelectedIndexChanged="GridView1_SelectedIndexChanged" >
            <FooterStyle CssClass="GV_footer" />
            <RowStyle Wrap="False" CssClass="GV_row" />
            <Columns>
                <asp:BoundField DataField="MessaggioID" 
                    HeaderText="MessaggioID" SortExpression="MessaggioID" Visible="False"  />
                <asp:BoundField DataField="DataDa" 
                    HeaderText="DataDa" SortExpression="DataDa" 
                    DataFormatString="{0:dd-MM-yyyy}" />
                <asp:BoundField DataField="Titolo" HeaderText="Titolo" 
                    SortExpression="Titolo" />
                <asp:BoundField DataField="Messaggio" HeaderText="Messaggio" 
                    SortExpression="Messaggio" >
                <HeaderStyle Width="100px" />
                <ItemStyle Width="100px" Wrap="True" />
                </asp:BoundField>
                <asp:CommandField ButtonType="Image" 
                    DeleteImageUrl="/timereport/images/icons/16x16/trash.gif" 
                    SelectImageUrl="/timereport/images/icons/16x16/modifica.gif" 
                    ShowDeleteButton="True" ShowSelectButton="True" />
            </Columns>
            <PagerStyle CssClass="GV_footer" />
            <HeaderStyle CssClass="GV_header" />
            <AlternatingRowStyle CssClass="GV_row_alt " />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MSSql12155ConnectionString %>" 
            SelectCommand="SELECT * FROM [Messaggi] WHERE [DataA] &gt;=  GETDATE() AND [DataDA] &lt;= GETDATE() "
            DeleteCommand="DELETE FROM [Messaggi] WHERE [MessaggioID] = @MessaggioID">
            <DeleteParameters>
                <asp:Parameter Name="MessaggioID" />
            </DeleteParameters>
        </asp:SqlDataSource>
    </div>
   <asp:Button ID="btn_crea" runat="server" Text="Crea record" CssClass="Gridbutton"
        PostBackUrl="/timereport/m_gestione/Messaggi_lookup_form.aspx" />
    <asp:Button ID="btn_back" runat="server" Text="Annulla" CssClass="Gridbutton" PostBackUrl="/timereport/menu.aspx" />
   
    </form>
    </td>
    </table>

</body>
</html>
